import api from '../index'
import tools from '@/tools'

// 查询审批列表
export const listLeave = (params) => {
  const url = '/vapi/activity/actleave/list'
  return api.get(url,params)
}

// 查询审批列表
export const listLeaveAll = (params) => {
  const url = '/vapi/activity/actleave/listAll'
  return api.get(url,params)
}


// 查询审批详细
export const getLeave = (id) => {
  const url = '/vapi/activity/actleave/'+id
  return api.get(url)
}


// 新增审批
export const addLeave = (data) => {
  const url = '/vapi/activity/actleave'
  return api.post(url,data)
}


// 判断是否有审批流定义，显示预占按钮
export const showBtn = (data) => {
  const url = '/vapi/activity/actleave/ByUserid'
  return api.get(url,data)
}


// 修改审批
export const updateLeave = (data) => {
  const url = '/vapi/activity/actleave'
  return api.put(url, data)
}


// 删除审批
export const delLeave = (id) => {
  const url = '/vapi/activity/actleave/'+id
  return api.delete(url)
}

// 导出审批
export const exportLeave = (params) => {
  const url = '/vapi/activity/actleave/export'
  return api.get(url,params)
}